home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
jikes
/
src
/
tab.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-05-14
|
848b
|
33 lines
// $Id: tab.cpp,v 1.1 1999/02/12 14:39:13 shields Exp $
//
// This software is subject to the terms of the IBM Jikes Compiler
// License Agreement available at the following URL:
// http://www.ibm.com/research/jikes.
// Copyright (C) 1996, 1999, International Business Machines Corporation
// and others. All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
#include "tab.h"
int Tab::tab_size = Tab::DEFAULT_TAB_SIZE;
//
// Compute the length of a wide character string segment
// after expanding tabs.
//
int Tab::Wcslen(wchar_t *line, int start, int end)
{
for (int i = start--; i <= end; i++)
{
if (line[i] == U_HORIZONTAL_TAB)
{
int offset = (i - start) - 1;
start -= ((tab_size - 1) - offset % tab_size);
}
}
return (end - start);
}